//
//  HEAudioRecordManage.h
//  HealthFamily
//
//  Created by 吴欧 on 2020/12/4.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, HEAudioRecordState) {
    HEAudioRecordStateFinish, // 完成录音
    HEAudioRecordStateCancel, // 取消录音
};

NS_ASSUME_NONNULL_BEGIN

@protocol HEAudioRecordManageDelegate <NSObject>

- (void)audioRecordFinishedWithFilePath:(NSString *)filePath time: (NSInteger)time;

@end

typedef void(^updatePowerBlock)(CGFloat power);

@interface HEAudioRecordManage : NSObject

@property (nonatomic, weak) id <HEAudioRecordManageDelegate> delegate;

+  (instancetype)sharedManager;

@property(nonatomic,assign)BOOL isRecording;

- (void)removeFileAtPath:(NSString *)path;

/// 获取音量
- (void)updatePower:(updatePowerBlock)block;

/// 开始播放
- (void)startRecord;

/// 结束播放
- (void)endRecord; 

/// 取消录制
- (void)cancelRecord;

@end

NS_ASSUME_NONNULL_END
